/**
* Oxide
*
* Copyright (c) 2011 Dinosaur Kick Pty Ltd, All rights reserved.
*
* This source code is made available under the "Modified BSD" licensing arrangement.
* See license.txt for details.
*/
// ----------------------------------------------------------------------------
#include <string>
#include "message_level.hpp"
// ----------------------------------------------------------------------------
#ifndef O2_PARSE_MESSAGE_INC
#define O2_PARSE_MESSAGE_INC
namespace o2 {
namespace parse {
// ----------------------------------------------------------------------------

template <typename StringT>
class basic_message
{
	public:
		typedef StringT string_type;
		typedef typename std::char_traits<typename string_type::value_type>::off_type offset_type;
		
		basic_message(void)
			: line(0)
			, column(0)
			, level(ML_NONE)
			{ }

		basic_message(offset_type line, offset_type column, message_level level, const string_type& text)
			: line(line)
			, column(column)
			, level(level)
			, text(text)
			{ }

		basic_message(const basic_message& n)
			: line(n.line)
			, column(n.column)
			, level(n.level)
			, text(n.text)
			{ }

		offset_type line;
		offset_type column;
		message_level level;
		string_type text;
};

// ----------------------------------------------------------------------------

typedef basic_message<std::string> message;
typedef basic_message<std::wstring> wmessage;

// ----------------------------------------------------------------------------
} // namespace parse
} // namespace o2
#endif // O2_PARSE_MESSAGE_INC
// ----------------------------------------------------------------------------
